# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-alive-progress
_pkgname=alive-progress
pkgver=3.3.0
_pyver=3.13
pkgrel=1
pkgdesc='A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations.'
arch=('any')
url='https://pypi.org/project/alive-progress/#files'
license=('MIT')
depends=('python' 'python-about-time' 'python-grapheme')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('91af23174c821f39f2bd87764b173350e81ac09b01444b78b0e2bf71fdf20d673e8392f0d41815a22faa90f0b3e815be7c6c60c7ee808bf57d803144397a3fb3')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --no-isolation
}

package() {
  cd "$_pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/share/licenses/$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  mv "$pkgdir/usr/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/tests"
}

